﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RedHouse.Data.Service;

namespace RedHouse.Data.Base
{
    public class LocationService:ILocationService
    {
        #region Declaration
        NewRedHouseEntitiesDataContext _dataContext;
        #endregion

        public LocationService()
        {
            _dataContext = new NewRedHouseEntitiesDataContext();
        }

        #region ILocationService Members

        public List<Location> GetAllLocation()
        {
            return _dataContext.Locations.ToList();
        }

        public Location GetLocationById(int id)
        {
            return _dataContext.Locations.Where(l => l.ID == id).FirstOrDefault();
        }
        #endregion
    }
}
